package com.zonhar.autofeed.controller;

import com.zonhar.autofeed.common.R;
import com.zonhar.autofeed.entities.entity.SensorLogEntity;
import com.zonhar.autofeed.service.SensorLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/sensor/log")
public class SensorLogController {

    @Autowired
    private SensorLogService sensorLogService;

    @GetMapping("/page")
    public R pageList(Integer size){
       List<SensorLogEntity> sensorLogEntityList  =sensorLogService.pageList(size);
       return R.ok().put("data",sensorLogEntityList);
    }
}
